Skip to content

[Runtimes][CMake] Add CMake option to enable execute-only code generation on AArch64 #143698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Il-Capitano
Copy link
Contributor

Based on the discussion in https://discourse.llvm.org/t/rfc-execute-only-code-support-for-runtime-libraries-on-aarch64/86180 a single, global configuration option should be used to enable execute-only code generation for the runtime libraries. The new option LLVM_EXECUTE_ONLY_CODE adds the -mexecute-only flag to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS, which simplifies the library-level configuration needed for the runtime libraries.

Project-specific changes are still needed to handle assembly sources, e.g. in compiler-rt and libunwind.

…tion on AArch64

Based on the discussion in https://discourse.llvm.org/t/rfc-execute-only-code-support-for-runtime-libraries-on-aarch64/86180
a single, global configuration option should be used to enable
execute-only code generation for the runtime libraries. The new option
`LLVM_EXECUTE_ONLY_CODE` adds the `-mexecute-only` flag to
`CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`, which simplifies the
library-level configuration needed for the runtime libraries.

Project-specific changes are still needed to handle assembly sources,
e.g. in compiler-rt and libunwind.
@Il-Capitano
Copy link
Contributor Author

@ldionne
In a comment on #140555 @petrhosek suggested I change the CMake option's name to RUNTIMES_EXECUTE_ONLY_CODE. You also suggested this name previously on the discourse RFC.
Should I make that change? My main hold-up on making that change is that I don't see any other CMake option following that naming convention in current main, but if this is the convention that should be used going forward I'm happy to make that change.

@Il-Capitano Il-Capitano requested a review from petrhosek June 25, 2025 13:07
@petrhosek
Copy link
Member

@ldionne In a comment on #140555 @petrhosek suggested I change the CMake option's name to RUNTIMES_EXECUTE_ONLY_CODE. You also suggested this name previously on the discourse RFC. Should I make that change? My main hold-up on making that change is that I don't see any other CMake option following that naming convention in current main, but if this is the convention that should be used going forward I'm happy to make that change.

That's because we don't yet have a runtimes-specific variables but we expect to have more soon (see for example #134893 which introduces RUNTIMES_USE_LIBC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants